<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>合并两个对象</title>
</head>
<body>
    <script>
        const user = {
            name: 'Kapil Raghuwanshi',
            gender: 'Male'
        };
        const college = {
            primary: 'Mani Primary School',
            secondary: 'Lass Secondary School'
        };
        const skills = {
            programming: 'Extreme',
            swimming: 'Average',
            sleeping: 'Pro'
        };

        const summary = {...user, ...college, ...skills};
        console.log('%c   summary: ','color: MidnightBlue; background: Aquamarine; font-size: 20px;', summary);

        // todo:合并多个对象
        // gender: "Male"
        // name: "Kapil Raghuwanshi"
        // primary: "Mani Primary School"
        // programming: "Extreme"
        // secondary: "Lass Secondary School"
        // sleeping: "Pro"
        // swimming: "Average"


        function myFun(a,  b, ...manyMoreArgs) {
            return arguments.length;
        }
        let r=myFun("one", "two", "three", "four", "five", "six");

        // 输出: 6
        console.log('%c   r: ','color: MidnightBlue; background: Aquamarine; font-size: 20px;', r);
        const parts = ['shoulders', 'knees'];
        const lyrics = ['head', ...parts, 'and', 'toes'];
        console.log('%c   lyrics: ','color: MidnightBlue; background: Aquamarine; font-size: 20px;', lyrics);

        // lyrics;
        // 输出:
        // (5) ["head", "shoulders", "knees", "and", "toes"]


    </script>
</body>
</html>